<?php
/**
* @package      auto_occasion
* @subpackage   app init
* @author       CMS
* @copyright    2011
* @license      All rights reserved
*/

$appPath = dirname (__FILE__).'/';
require (realpath($appPath.'../../jelix-1.3-dev/lib/jelix/').'/'.'init.php');

jApp::initPaths(
    $appPath,
    $appPath.'www/',
    $appPath.'var/',
    $appPath.'var/log/',
    $appPath.'var/config/',
    $appPath.'scripts/'
);
jApp::setTempBasePath(realpath($appPath.'../../jelix-1.3-dev/temp/auto_occasion/').'/');

include ($appPath . './var/config/ao.config.ini.php');

// google api key en fonction du serveur

$serverIp = (isset($_SERVER['SERVER_ADDR'])) ? $_SERVER['SERVER_ADDR'] : "";
switch ($serverIp) {
    case '127.0.0.1' : 
        define('GOOGLE_MAP_API_KEY_DEV', 'ABQIAAAAEkWf9LZ6vhoH4XyH_ivQIxRXIbFL-Vj-8wu-M80P66JSDt89ZRRrqYYO-tafiR4HXBTPwHf1T-vgjA'); 
        define('LINK_PAIEMENT_CB', 'http://dev53.medias-solution.mg/auto_occasion/www/cgi-bin/modulev3.cgi'); 
        break; // local

    case '88.191.132.181' : 
        define('GOOGLE_MAP_API_KEY_DEV', 'ABQIAAAAEkWf9LZ6vhoH4XyH_ivQIxRCCXBByFUHg7LdUAeErJrhouk8JhTFnQX8J-qRjIKa2smuau7lEUsPyg'); 
        define('LINK_PAIEMENT_CB', 'http://sd-24204.dedibox.fr/auto-occasion/srcs/cgi-bin/modulev2.cgi'); 
        break; // serveur de test dedibox
}
